$(document).ready(function(){
	initGrid({
		url: 'getJson.json'
	});
	
	addSubmit();
	showEditModal('user');
});

function initGrid(options){
	
	var colModel = [
	                { label: '编号', name: 'id', key: true, width: 55, fixed:true },
	                { label: '用户编号', name: 'code', width: 150 },
	                { label: '用户名', name: 'username', width: 150 },
	                { label: '员工编号', name: 'staffCode', index:'staff_code', width: 150 },
	                { label: '角色', name: 'role', width: 150 },
	                { label: '有效性', name: 'available', width: 55, fixed:true, formatter: function(cellValue, options, rowObject){
	                	return cellValue == 0 ? '否' : '是';
	                } },
	                { label: '添加时间', name: 'addtime', width: 150 },
	                { label:'操作', name: '', width: 150, formatter: customActions },
	            ];
	options.colModel = colModel;
	customGrid.init(options);
}